package control;
import java.io.BufferedWriter;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;

/**
 * PrintFile
 * pequena classe para abrir arquivos de saida para uma leitura por humanos.
 * @author Adriano de Albuquerque Batista
 * @author Alfeu Buriti
 * @author Pablo Diego Alencar
 * @author Yuri Cariry Cabral de Melo
 * 
 */
public class PrintFile {

	public PrintFile(String filename, String content) {

		System.out.println("Inicio do PrintFile -> PrintFile ");
		try {
			BufferedWriter out = new BufferedWriter(new OutputStreamWriter(
					new FileOutputStream(filename), "UTF-8"));
			// escreve content em out
			out.write(content);
			out.close();
		} catch (IOException exc) {
			System.err.println("I/O error writing to" + filename);
		}

		System.out.println("Inicio do PrintFile -> PrintFile ");
	}
}
